<!--河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
-->
<template>
  <div class='app-container'>
    <el-row>
      <el-col :span='22' :xs='24'>
        <el-form ref="form" :model="produce_sale" :rules="rules" label-width="100px" id="mvcfm">
          <el-button @click="increaseServiceProSubmit('')" type='success' size="mini"><i class='fa fa-check'></i>保存</el-button>
          <el-button @click="gotoPage('/mes/produce/ServiceProAction?'+vueparams+'')" type='primary' size="mini"><i class='fa fa-reply'></i>返回</el-button>
          <div class="form-unit">
            <span class="mvc-title-left"> 增加售后服务 </span>
          </div>
          <div>
            <el-row>
              <el-col :span="12">
                <el-form-item label="标题" prop="sale_title">
                  <el-input v-model="produce_sale.sale_title" />
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item label="售后人员" prop="sale_person">
                  <el-input v-model="produce_sale.sale_person" />
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item label="服务时间" prop="sale_time">
                  <el-date-picker v-model="produce_sale.sale_time" type="date" style='width:100%' value-format="yyyy-MM-dd" />
                </el-form-item>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="24">
                <el-form-item label="服务说明" prop="sale_remark">
                  <el-input type="textarea" v-model="produce_sale.sale_remark" ttparea=350></el-input>
                </el-form-item>
              </el-col>
            </el-row>
          </div>
        </el-form>
      </el-col>
      <el-col :span='2' :xs='24'>
        <el-menu default-active='active' class='menu-unit'>
          <el-menu-item v-for='item in Container'>
            <el-link @click="gotoMenu(item.url)" :type="'售后服务'===item.name?'primary':'default'">{{item.page_desc||item.name}}</el-link>
          </el-menu-item>
        </el-menu>
      </el-col>
    </el-row>
  </div>
</template>
<script>
  import request from '@/utils/request'
  export default {
    name: 'IncreaseServicePro',
    components: {},
    props: ['popparams'],
    data() {
      return {
        vueparams: this.getVUEParams(""),
        produce_sale: {
          sale_title: null,
          sale_person: null,
          sale_time: null,
          sale_remark: null,
        },
        loading: false,
        Container: null,
        rules: {}
      }
    },
    created() {
      this.loadContainerMenu({
        pid: "D797D94B97264F339A7F3838BB343F64",
        name: "生产设备右菜单",
        selected: "售后服务"
      }, 'Container', this.vueparams);
    },
    updated() {},
    mounted() {},
    methods: {
      increaseServiceProSubmit(_params) {
        this.$refs["form"].validate(valid => {
          if (valid) {
            request({
              method: 'post',
              url: '/xcapi/VUEAction/mes/produce/ServiceProAction/increaseServiceProSubmit?' + _params + this.vueparams,
              data: this.postData()
            }).then(data => {
              this.gotoPage("/mes/produce/ViewServicePro/viewServicePro?" + this.vueparams, data);
              this.msgSuccess(data.msg);
            })
          } else {
            this.msgError("必填项错误");
          }
        });
      },
    },
  }
</script>
